package edu.joe.demo.mapper;

import dao.IMibModuleDao;
import edu.joe.demo.entity.MibDbModule;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface MibModuleMapper extends JpaRepository<MibDbModule, Integer> {
    @Query(value = "select ifnull((select 1 from mib_module where name = ?1), 0)", nativeQuery = true)
    int isModuleExist(String moduleName);

    void deleteByModuleName(String moduleName);
}
